
import { Button } from 'antd';
import React, { Component } from 'react'
import SonA from './SonA'

export default class Parent extends Component {

  constructor(props){
    super(props);
    this.props = props;
    this.state={
      msg:"hello，兄弟"
    }
  }

  fn=(str)=>{
    this.setState({
      msg:str
    })
  }
    
  render() {
    return (
        <>
        <h1>状态树(越级传递)</h1>
        <div>Parent</div>
       
        <SonA chuan={this.fn} ></SonA>
      </>
    )
  }
}
